{% extends "home/home.html" %}
{% block content %}
    <div class="container" style="margin-top:120px">
        <div class="row">
            <div class="col-md-4 col-md-offset-4">
                {% for msg in get_flashed_messages(category_filter=["OK"]) %}
                    <div class="alert alert-success alert-dismissible" role="alert">
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        <h4 class="alert-heading"><i class="icon fa fa-check"></i>{{ msg }}</h4>
                    </div>
                {% endfor %}

                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h3 class="panel-title"><span class="glyphicon glyphicon-log-in"></span>&nbsp;会员登录</h3>
                    </div>
                    <div class="panel-body">
                        <form role="form" method="post">
                            <fieldset>
                                <div class="form-group">
                                    <label for="input_contact"><span
                                            class="glyphicon glyphicon-user"></span>&nbsp;{{ form.account.label }}
                                    </label>
                                    {{ form.account }}
                                    {% for err in form.account.errors %}
                                        <div class="col-md-12">
                                            <font style="color:red">{{ err }}</font>
                                        </div>
                                    {% endfor %}
                                </div>
                                <div class="col-md-12" id="error_contact"></div>
                                <div class="form-group">
                                    <label for="input_password"><span
                                            class="glyphicon glyphicon-lock"></span>&nbsp;{{ form.passwd.label }}
                                    </label>
                                    {{ form.passwd }}
                                    {% for err in form.passwd.errors %}
                                        <div class="col-md-12">
                                            <font style="color:red">{{ err }}</font>
                                        </div>
                                    {% endfor %}
                                    {% for msg in get_flashed_messages(category_filter=["Error"]) %}
                                        <div class="col-md-12">
                                            <font style="color:red">{{ msg }}</font>
                                        </div>
                                    {% endfor %}
                                </div>
                                <div class="col-md-12" id="error_password"></div>
                                {{ form.csrf_token }}
                                {{ form.submit }}
                            </fieldset>
                        </form>
                    </div>
                </div>
                <div style="height: 100%; line-height: 100%;">
                    <p>没有账号？<a href="{{ url_for('home.register') }}">注册</a></p>
                </div>
            </div>
        </div>
    </div>

{% endblock %}
